import {BaseConfig, FieldConfig, OptionItem} from "@/fields/config";

export class CheckboxConfig extends BaseConfig {
  title = "多项选择";
  propsValue = {
    'checkbox': 'checkbox'
  }
}

const fieldType = "checkbox";

export const checkboxDefine = {
  name:"多项选择",
  icon:"el-icon-s-operation",
  type: fieldType,
  create: () => {
    const checkboxConfig = new CheckboxConfig();
    for (let i = 1; i < 4; i++) {
      checkboxConfig.optionList.push(new OptionItem("选项" + i))
    }
    return new FieldConfig(fieldType, checkboxConfig);
  },
  design: () => import(/* webpackChunkName: "form.comp.all" */ "@/views/fields/designer/checkbox/index"),
  config: () => import(/* webpackChunkName: "form.comp.all" */ "@/views/fields/common/PropsPanel")
}
